//
//  VOHMVNavigationBar.m
//  VoiceOfHeart
//
//  Created by 吉龙 on 16/8/15.
//  Copyright © 2016年 吉龙. All rights reserved.
//

#import "VOHMVNavigationBar.h"

@interface VOHMVNavigationBar ()

@property(nonatomic, strong)UITextField *input;

@property(nonatomic, strong)UIImageView *searchImage;
@end



@implementation VOHMVNavigationBar

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setUpView];
    }
    return self;
}


-(void)setUpView{
//    self.barTintColor = [UIColor darkGrayColor];
    [[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];
    UIImageView *searchImage = [[UIImageView alloc] init];
    
    searchImage.image = [UIImage imageNamed:@"Search_Icon_18x18_@2x"];
    self.searchImage = searchImage;
    
     self.searchImage.frame = CGRectMake(10, 0, 18, 18);
//    [self addSubview:self.searchImage];
    
    UIView *bakgroundview =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 28, 18)];
    bakgroundview.backgroundColor = [UIColor clearColor];
    [bakgroundview addSubview:self.searchImage];
    UITextField *input = [[UITextField alloc] init];
    input.borderStyle = UITextBorderStyleRoundedRect;
    input.clearButtonMode = UITextFieldViewModeAlways;
    input.layer.cornerRadius = 15;
    input.placeholder = @"请输入艺人、MV";
    input.leftViewMode = UITextFieldViewModeAlways;
    input.leftView = bakgroundview;
    [self addSubview:input];
    input.backgroundColor = [UIColor whiteColor];
    self.input = input;
    self.historyBtn = [VOHButton creatButtonWithFrame:CGRectMake(350, 3, 40, 40) Title:nil HighLightImageName:nil ImageName:@"home_history_40x40_@2x"];
    [self addSubview:self.historyBtn];
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.input.frame = CGRectMake(20, 5, 280, 30);
    
   
    
}



@end
